package com.yexx.sc.microsvrapi.feign.fallback;

import com.yexx.sc.microsvrapi.domain.City;
import com.yexx.sc.microsvrapi.feign.CityFeign;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.List;

@Component
public class CityFeignFallBack implements FallbackFactory<CityFeign> {

    @Override
    public CityFeign create(Throwable throwable) {
        return new CityFeign() {
            @Override
            public List<City> list() {
                return Collections.emptyList();
            }
        };
    }
}
